package cc.rengu.redp.bizimpl.upmp.service;

import cc.rengu.redp.bizimpl.upmp.domain.BDeviceInfo;
import cc.rengu.redp.bizimpl.upmp.domain.UpmpOrganization;
import cc.rengu.redp.bizimpl.upmp.vo.UpmpUserInfoVO;
import cc.rengu.redp.common.domain.QueryRequest;
import cc.rengu.redp.common.exception.RedpException;
import cc.rengu.redp.bizimpl.upmp.domain.BizHis;
import cc.rengu.redp.system.domain.User;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * 临时表service
 *
 * @author zhangxu
 */
public interface IBizHisService extends IService<BizHis> {
    /**
     * 保存临时表
     *
     * @param his BizHis
     */
    public void saveHis(BizHis his);

    /**
     * @param his BizHis
     */
    public void deleteAndInsert(BizHis his);

    /**
     * 根据realid获取临时表实体
     *
     * @param id realid
     * @return
     */
    public List<BizHis> getBizHisDetail(String id);

    IPage<BizHis> findByPage(QueryRequest request, BizHis info);

    /**
     * 保存记录到历史表，判断临时表是否有数据有则修改，无则新增
     * @param entity
     * @param user
     * @param instId
     * @param bizOpr
     * @param updateTime
     * @param oprMenuId
     * @param oprMenuName
     * @param realId
     * @param mchntNo
     * @param mchntName
     * @param termNo
     * @throws RedpException
     */
    void saveBizHisNew(Object entity, Object entityOld, UpmpUserInfoVO user, String instId, String bizOpr, String updateTime,
                       String oprMenuId, String oprMenuName, String realId, String mchntNo, String mchntName, String termNo) throws RedpException;

    void saveBizHisList(List<?> entitys, List<?> entityOlds, UpmpUserInfoVO user, String instId, List<String> bizOprs, String updateTime,
                        String oprMenuId, String oprMenuName, List<String> realIds, String mchntNo, String mchntName, String termNo) throws RedpException;

    String getHisBizChangeData(BDeviceInfo oldEntity, BDeviceInfo entity) throws RedpException;
}
